import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateParse {

    public final static String DEFAULT_PATTERN_DATETIME_SIMPLE = "yyyyMMddHHmmss";
    public final static String DEFAULT_PATTERN_DATETIME = "yyyy-MM-dd HH:mm:ss";

    public static void main(String[] args) throws ParseException {
        if(args == null || args.length == 0) {
            System.out.println("传入参数为空");
        }
        String dateStr = args[0];
        Date date = new SimpleDateFormat(DEFAULT_PATTERN_DATETIME_SIMPLE).parse(dateStr);
        System.out.println(date.getTime()/1000);

    }
}
